[core] Support snapshot-based sequence ordering for primary-key tables#7832
[core] Support snapshot-based sequence ordering for primary-key tables#7832JunRuiLee wants to merge 8 commits into
Conversation
36b0eaf to
2c737da
Compare
|
Hi @JingsongLi, could you help take a look? Many thanks. |
|
Thanks @leaves12138 for the review! Fixed the compaction ordering issue by persisting per-record snapshotId through _SEQUENCE_NUMBER column. Added tests for the scenario you described. Old constructor removed. PTAL, Thanks! |
09ba5c9 to
37cc344
Compare
leaves12138
left a comment
There was a problem hiding this comment.
Thanks for the update. I took another careful pass over the snapshot-ordering implementation. I think there are still a few correctness issues to address before this can be safely merged.
|
Thanks @leaves12138 for the careful review. I fixed the first two correctness issues:
I also added regression coverage for merge-function snapshotId preservation, partial-update compaction, aggregate compaction, and lookup buffer spill. For the ALTER TABLE concern: this option is annotated as immutable, so enabling it via ALTER on a table with existing snapshots is rejected; empty-table ALTER remains allowed. |
leaves12138
left a comment
There was a problem hiding this comment.
One remaining edge case around partial-update snapshot ordering.
973e270 to
1b503a7
Compare
|
This feature is more complex than it is expected. I can't figure out more corner case, but there must exist some cases we have not catch. This looks good to me, but it need more experts to review this feature. @JingsongLi |
Snapshot ordering relies on snapshot id to determine record order, but inline compaction happens before snapshot creation — files have not been stamped with the correct snapshot id yet. Compaction would propagate incorrect values to KV records. Enforce write-only=true at schema validation time so that writers use NoopCompactManager. Dedicated compact jobs override write-only at runtime via table.copy(), which passes dynamicOptionKeys to skip this specific check.
18c93e8 to
9e16681
Compare
|
@leaves12138 Thanks for the review! I've reorganized the commits to make the progression clearer. |
Purpose
close #7806
Tests